package bawei.com.adapter;

import android.support.v4.app.Fragment;

import android.support.v4.app.FragmentManager;

import android.support.v4.app.FragmentStatePagerAdapter;



import java.util.List;



import bawei.com.fragment.RegionTypeDetailsFragment;

import bawei.com.model.bean.ReginBean;

/**
 * 类描述:
 * 作者：cwm
 * 时间:2017/3/21 19:54
 * 邮箱:18310832074@163.com
 */

public class RegionTypeDetailsPageAdapter extends FragmentStatePagerAdapter {


    private List<ReginBean.DataBean.ChildrenBean> childrenBeen;

    public RegionTypeDetailsPageAdapter(FragmentManager fm, List<ReginBean.DataBean.ChildrenBean> childrenBeen) {
        super(fm);
        this.childrenBeen = childrenBeen;
    }

    @Override
    public Fragment getItem(int position) {
        return RegionTypeDetailsFragment.newInstance(childrenBeen.get(position).getTid());
    }

    @Override
    public int getCount() {
        return childrenBeen.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return childrenBeen.get(position).getName();
    }
}
